package com.cskaoyan.service;

import com.cskaoyan.bean.User;
import com.cskaoyan.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author zhangminghui
 * @date 2022/8/6
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    UserMapper userMapper; // idea报错

    @Transactional
    @Override
    public void addUser(User user) {
        userMapper.addUser(user);
    }

    @Transactional
    @Override
    public List<User> selectUserByUsername(String username) {
        List<User> userList = userMapper.selectUserByUsername(username);
        return userList;
    }
}
